﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DelegatesExample
{
    class Program
    {
        static void Main(string[] args)
        {
            PhotoProcessor processor = new PhotoProcessor();
            PhotoFilters filters = new PhotoFilters();

            Action<Photo> linksToFilters = filters.ChangeBrightness;
            linksToFilters += filters.ApplyColorScheme;
            linksToFilters += MyCustomFilter;
            linksToFilters += filters.ApplyColorScheme;

            processor.Process("image.jpg", linksToFilters);


            //Interface example
            Console.WriteLine();
            List<IPhotoFilter> photoFilters = new List<IPhotoFilter>
            {
                new BrightnessFilter(),
                new ColorFilter(),
                new ContrastFilter()
            };

            photoFilters.Add(new MyCustomPhotoFilter());

            processor.Process2("my.jpg", photoFilters);

        }

        static void MyCustomFilter(Photo photo)
        {
            Console.WriteLine("MyCustomFilter");
        }
    }

    class MyCustomPhotoFilter:IPhotoFilter
    {
        public void Apply(Photo photo)
        {
            Console.WriteLine("MyCustomFilter");
        }
    }
}
